
********************************************************************************
*    A matter of content. Overcoming the gender gap in political knowledge,    *
*    expression of knowledge, and interest. Replication material.              *
*    Silvia Keeling
********************************************************************************
********************************************************************************


* Use the dataset

use "overcoming the gender gap dataset.dta" 

********************************************************************************

*  Recode of POLITICAL KNOWLEDGE questions 
  
********************************************************************************

* cleaning of the dataset (no response)

fre ResponseId if Q23==. & Q2==.
drop if  ResponseId=="R_1M5jlfDx5Prdi1h" | ResponseId=="R_1esfVTpXEuZmOiG" | ///
ResponseId== "R_1k1aRKo5kjOrLc1" | ResponseId== "R_1lnGJ66Ubiw771x"| ///
ResponseId=="R_24C8P6mhat0yBpQ" | ResponseId== "R_2WYBGeYpzuvEk3C" | ///
ResponseId=="R_2XjIbgqp4Z0sDeC" | ResponseId=="R_2f33EcFUkDJ14Pm" | ///
ResponseId=="R_2xQtBxH2ZsFTgIP" | ResponseId=="R_33DTdM3euueN4hL" | ///
ResponseId=="R_3Olhd89DQ6J0VL6" | ResponseId=="R_3PGnyU9F4qCVmMc" | ///
ResponseId=="R_3R3hWkC31ZrTE7n" | ResponseId=="R_3dE4oJhfC79zQyn" | ///
ResponseId=="R_3dM5Z0PuG4JmGNd" | ResponseId=="R_3m1TOFi1b4Ue939" 

* Gender
rename Q20 sex
drop if sex==-99
gen female=sex-1

* DK protocol treatment
gen treatment=.
replace treatment=1 if Openendedcontrattamento_DO_Q28<6
replace treatment=0 if Openendedcontrattamento_DO_Q28==.

*date
fre RecordedDate
gen date=.
replace date=2019 if RecordedDate<=21900
replace date=2020 if RecordedDate>21900
tab RecordedDate date

*recode of open-ended questions

* 1) PRESIDENT OF THE CHAMBER OF DEPUTIES
* CONTROL
fre Q4
gen len=length(Q4)
summ len
recast str36 Q4, force
fre Q4 if treatment==0
screening if treatment==0, source(Q4 , upper trim itrim removesign) ///
key("camera|deputati" "non|so" "99" ) new (varr, numeric) recode (1 "1" 2 "2" 3 "2") explore(tab)
fre varr if treatment==0
recode varr (.=0)if treatment==0, gen (fico)
fre Q4 if fico==0
fre Q4 if fico==1
fre Q4 if fico==2
la de fico 0 "wrong" 1"right" 2"DK"
la val fico fico
drop len varr
* TREATED
fre Q29
gen len=length(Q29)
summ len
recast str62 Q29, force
fre Q29 if treatment==1
screening if treatment==1, source(Q29 , upper trim itrim removesign) ///
key("camera|deputati" "non|so" "99" ) new (varr, numeric) recode (1 "1" 2 "2" 3 "2") explore(tab)
fre varr if treatment==1
recode varr (.=0)if treatment==1, gen (ficob)
fre Q29 if ficob==0
fre Q29 if ficob==1
fre Q29 if ficob==2
la de ficob 0 "wrong" 1"right" 2"DK"
la val ficob ficob
drop len varr

* 2) PRESIDENT OF THE SENATE
* CONTROL
fre Q5
gen len=length(Q5)
summ len
recast str38 Q5, force
fre Q5 if treatment==0
screening if treatment==0, source(Q5 , upper trim itrim removesign) ///
key("senato" "non|so" "99" ) new (varr, numeric) recode (1 "1" 2 "2" 3 "2") explore(tab)
recode varr (.=0)if treatment==0, gen (casellati)
fre casellati
fre Q5 if casellati==0
fre Q5 if casellati==1
fre Q5 if casellati==2
la de casellati 0 "wrong" 1"right" 2"DK"
la val casellati casellati
drop len varr
* TREATED
fre Q30
gen len=length(Q30)
summ len
recast str47 Q30, force
fre Q30 if treatment==1
replace Q30 = subinstr(Q30, "Seanto","senato", .)
screening if treatment==1, source(Q30 , upper trim itrim removesign) ///
key("senato" "non|so" "99" ) new (varr, numeric) recode (1 "1" 2 "2" 3 "2") explore(tab)
recode varr (.=0)if treatment==1, gen (casellatib)
fre casellatib
fre Q30 if casellatib==0
fre Q30 if casellatib==1
fre Q30 if casellatib==2
la de casellatib 0 "wrong" 1"right" 2"DK"
la val casellatib casellatib
drop len varr

* 3) SOCIAL BENEFIT INCOME
* CONTROL
tab Q6
gen len=length(Q6)
summ len
recast str47 Q6, force
fre Q6 if treatment==0
replace Q6 = subinstr(Q6, "Tra 400 e 600","500", .)
screening if treatment==0, source(Q6 , upper trim itrim removesign) ///
key("600|670|700|740|750|765|780|800" "non|so" "99") new (varr, numeric) recode (1 "1" 2 "2" 3 "2") explore(tab)
recode varr (.=0)if treatment==0, gen (reddito)
fre reddito
fre Q6 if reddito==0
fre Q6 if reddito==1
fre Q6 if reddito==2
la de reddito 0 "wrong" 1"right" 2"DK"
la val reddito reddito
drop len varr
* TREATED
tab Q31
gen len=length(Q31)
summ len
recast str47 Q31, force
fre Q31 if treatment==1
replace Q31 = subinstr(Q31, "500/600 euro mensili","500", .)
replace Q31 = subinstr(Q31, "Nom","non", .)
screening if treatment==1, source(Q31 , upper trim itrim removesign) ///
key("600|670|700|730|770|780|800" "non|so" "99") new (varr, numeric) recode (1 "1" 2 "2" 3 "2") explore(tab)
recode varr (.=0)if treatment==1, gen (redditob)
fre casellatib
fre Q31 if redditob==0
fre Q31 if redditob==1
fre Q31 if redditob==2
la de redditob 0 "wrong" 1"right" 2"DK"
la val redditob redditob
drop len varr

* 4) MATERNITY LEAVE
* CONTROL 
fre Q7
gen len=length(Q7)
summ len
recast str36 Q7, force
fre Q7 if treatment==0
screening if treatment==0, source(Q7 , upper trim itrim removesign) ///
key("24" "cinque|sei|5|6" "non|so" "99" ) new (varr, numeric) recode (1 "3" 2 "1" 3 "2" 4 "2") explore(tab)
fre varr if treatment==0
recode varr (.=0) (3=0) if treatment==0, gen (maternità)
fre Q7 if maternità==0
fre Q7 if maternità==1
fre Q7 if maternità==2
la de maternità 0 "wrong" 1"right" 2"DK"
la val maternità maternità
drop len varr
* TREATED
fre Q28
gen len=length(Q28)
summ len
recast str36 Q28, force
fre Q28 if treatment==1
screening if treatment==1, source(Q28 , upper trim itrim removesign) ///
key("cinque|sei|5|6" "non|so" "99" ) new (varr, numeric) recode (1 "1" 2 "2" 3 "2") explore(tab)
fre varr if treatment==1
recode varr (.=0)if treatment==1, gen (maternitàb)
fre Q28 if maternitàb==0
fre Q28 if maternitàb==1
fre Q28 if maternitàb==2
la de maternitàb 0 "wrong" 1"right" 2"DK"
la val maternitàb maternitàb
drop len varr


* RECODE CLOSED-ENDED control
fre Q2 - Q11
* % OF SEATS OF M5S
recode Q2(2=1 "right")(1 3 4=2 "wrong")(5 -99=3 "non so"), gen (m5s)
* % OF SEATS HELD BY WOMEN
recode Q9(3=1 "right")(1 2 4=2 "wrong")(5=3 "non so"), gen (donne)
* FIRST REPUBLIC
recode Q11(4=1 "right")(1 2 3=2 "wrong")(5=3 "non so"), gen (primarep)
* DIVORCE LAW
recode Q3(3=1 "right")(1 2 4=2 "wrong")(5=3 "non so"), gen (divorzio)
fre m5s - primarep

* RECODE CLOSED-ENDED treated
fre Q23 - Q26
* % OF SEATS OF M5S
recode Q23(2=1 "right")(1 3 4=2 "wrong"), gen (t_m5s)
* % OF SEATS HELD BY WOMEN
recode Q24(3=1 "right")(1 2 4=2 "wrong"), gen (t_donne)
* FIRST REPUBLIC
recode Q26(4=1 "right")(1 2 3=2 "wrong")(-99=3 "non so"), gen (t_primarep)
* DIVORCE LAW
recode Q25(3=1 "right")(1 2 4=2 "wrong"), gen (t_divorzio)
fre t_m5s - t_primarep
